<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8" />
    <title>Crumb - ESUI Demo</title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="assets/google-code-prettify/prettify.css" />
    <link rel="stylesheet" href="assets/themes/standard.css" />
    <!--[if lt IE 9]>
    <link rel="stylesheet" href="assets/ie8.css" />
    <![endif]-->
</head>
<body>
    <div class="header">
        <h1 id="branding">ESUI - Crumb</h1>
    </div>
    <div class="ui-g main-container">
        <div id="side-bar" class="ui-u-1-5">
            <ul id="navigator" class="ui-nav">
            </ul>
        </div>
        <div id="main" class="ui-u-4-5">
            <h2>HTML静态</h2>
            <div class="example ui-demo-light-stage">
                <div id="container" class="row">
                    <div data-ui-type="Crumb" 
                        data-ui-separator=''
                        data-ui-separator-class='ui-icon-angle-right'>
                        <a href="#1">Node1</a>
                        <a href="#2">Node2</a>
                        <a href="#3">Node3</a>
                        <a href="#4">Node4</a>
                        <span>Node5</span>
                    </div>
                </div>
            </div>
            <h2>JS动态创建</h2>
            <div class="intro">
                <p>使用JS创建<code>Crumb</code>，配置参数属性。</p>
            </div>
            <div class="example ui-demo-light-stage">
                <div class="ui-crumb-nav-container">
                    <div id="nav-container">
                    </div>
                    <div class="ui-tip" data-ui="type:Tip;id:auto-tip-auto;content:Hello;"></div>
                </div>
            </div>
            <script type="text/sample">
                var path = [
                    {
                        text: '首页',
                        href: 'http://test.com'
                    },
                    {
                        text: '投放管理',
                        href: 'http://test2.com'
                    },
                    {
                        text: '订单管理'
                    }
                ];

                var crumb = new Crumb({
                    path: path,
                    variants: ['nav'],
                    separator: '',
                    separatorClass: 'ui-icon-angle-right'
                    main: document.getElementById('nav-container')
                });
                crumb.render();
            </script>
            <h2>自定义样式</h2>
            <div class="intro">
                <p>使用JS创建<code>Crumb</code>对象，设置参数<code>separator</code>可以自定义分隔符。</p>
            </div>
            <div class="example ui-demo-light-stage">
                <div id="container2" class="row">
                </div>
            </div>
            <script type="text/sample">
                var path = [
                    {
                        text: '首页',
                        href: 'http://test.com'
                    },
                    {
                        text: '投放管理',
                        href: 'http://test2.com'
                    },
                    {
                        text: '订单管理'
                    }
                ];

                var crumb2 = new Crumb({
                    path: path,
                    separator: '',
                    separatorClass: 'ui-icon-angle-left'
                });
                crumb2.appendTo(document.getElementById('container2'));
            </script>
        </div>
    </div>
    <script src="assets/loader/esl.js"></script>
    <script src="config.js"></script>
    <script src="demo.js"></script>
    <script src="assets/google-code-prettify/prettify.js"></script>
    <script id="main-js">
    require(
        [
            'esui',
            'esui/Crumb',
            'esui/Tip',
            'esui/Tab',
            'demo'
        ],
        function (ui, Crumb) {
            ui.init();
            var path = [
                {
                    text: '首页',
                    href: 'http://test.com'
                },
                {
                    text: '投放管理',
                    href: 'http://test2.com'
                },
                {
                    text: '订单管理'
                }
            ];

            var crumb = new Crumb({
                path: path,
                variants: ['nav'],
                main: document.getElementById('nav-container'),
                separator: '',
                separatorClass: 'ui-icon-angle-right'
            });
            crumb.render();

            var crumb2 = new Crumb({
                path: path,
                separator: '',
                separatorClass: 'ui-icon-angle-right'
            });
            crumb2.appendTo(document.getElementById('container2'));
        }
    );
    </script>
    <script src="sitemap.js"></script>
</body>
</html>